@extends('layouts.default')  
@section('content')
<div class="box primary">        
    <header>
        <h5>{{Lang::get('messages.add_maintenance')}}</h5>
        <!-- .toolbar -->
        <div class="toolbar">
            <nav style="padding: 8px;">
                <a href="javascript:;" class="btn btn-default btn-xs collapse-box">
                    <i class="fa fa-minus"></i>
                </a> 
                <a href="javascript:;" class="btn btn-default btn-xs full-box">
                    <i class="fa fa-expand"></i>
                </a> 
                <a href="javascript:;" class="btn btn-danger btn-xs close-box">
                    <i class="fa fa-times"></i>
                </a> 
            </nav>
        </div><!-- /.toolbar -->
    </header>
    <div id="div-1" class="body">
        {{ Form::open(array(
                        'url' => 'maintenance/store', 
                        'class'=>'form-horizontal',
                        'id'=>'form-validate')) 
        }}         
        <div class="form-group">
            {{ Form::label('process', Lang::get('messages.process').'*', array(
                            'class'=>'control-label col-lg-4')) 
            }}
            <div class="col-lg-8">
                {{ Form::select('process', $process, Input::old('process'), array( 
                                'class' => 'form-control',
                                'placeholder' => Lang::get('messages.process'))) 
                }}             
            </div>
        </div>  
        <div class="form-group">

            {{ Form::label('description',Lang::get('messages.description'), array(
                            'class'=>'control-label col-lg-4')) 
            }}
            <div class="col-lg-8">
                {{ Form::textarea('description', Input::old('description'), array(
                                'class' => 'form-control',
                                'placeholder' => Lang::get('messages.write_description'))) 
                }}
                <br/>
            </div>
        </div>
        <div class="alert alert-info">
            {{ Lang::get('messages.maint_insert_message') }}
        </div> <br/>
        <div class="row form-group">
            {{ Form::label('price', Lang::get('messages.price').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-4">
                {{ Form::text('price', Input::old('price'), array( 
                                'class' => 'form-control',
                                'placeholder' => Lang::get('messages.price'))) 
                }}              
            </div>
            <div class="col-lg-4">
                {{ Form::select('currency', $currencies, Input::old('currency'), array( 
                                'class' => 'form-control')) 
                }}                      
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('maintenance_date', Lang::get('messages.maintenance_date').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-8">
                {{ Helpers\Helper::date('maintenance_date', Input::old('maintenance_date') , array(
                                'class' => 'form-control',
                            )) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('km_due', Lang::get('messages.km_due'), array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-8">
                {{ Form::text('km_due', isset($km_due) ? $km_due : '', array( 
                                'class' => 'form-control')) 
                }}              
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('month_due', Lang::get('messages.month_due'), array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-8">
                {{ Form::text('month_due', isset($month_due) ? $month_due : '', array( 
                                'class' => 'form-control')) 
                }}              
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('service', Lang::get('messages.service').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-8">
                {{ Form::select('service', $services, Input::old('service'), array( 
                                'class' => 'form-control')) 
                }}             
            </div>
        </div>    
        <div class="form-group">
            {{ Form::label('nr_invoice', Lang::get('messages.nr_invoice'), array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-8">
                {{ Form::text('nr_invoice', Input::old('nr_invoice'), array( 
                                'class' => 'form-control',
                                'placeholder'=>Lang::get('messages.nr_invoice'))) 
                }}              
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('type', Lang::get('messages.type_maintenance').'*',array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-8">
                {{ Form::select('type', array(
                                '' => '',
                                'Inspection' => Lang::get('messages.inspection'), 
                                'Maintenance' => Lang::get('messages.maintenance')),
                        Input::old('trans'), array(
                                'class' => 'form-control',
                                ))
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('comment',Lang::get('messages.comment'), array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-8">
                {{ Form::textarea('comment', Input::old('comment'), array(
                                'class' => 'form-control',
                                'placeholder'=>Lang::get('messages.write_comment'))) }}
                <br/>
                <div id="validation-div" class="">
                </div>
            </div>
        </div>
        {{ Form::hidden('car_id', $car_id) }}
        {{ Form::submit(Lang::get('messages.save_btn'), array(
                        'class' => 'btn btn-success btn-line'))
        }}
        <input type="button" value="{{Lang::get('messages.cancel_btn')}}" class="btn btn-danger btn-line" onClick="history.go(-1);
                return true;">
        {{ Form::close() }}            
    </div>
</div> 
@stop
